package com.hujesse.controller;
import com.hujesse.pojo.Dept;
import com.hujesse.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



// 这里的service应该是api模块里面的service，分离开来。
@RestController
public class DeptConsumerController {

    @Autowired
    DeptService deptService;

    @RequestMapping("/consumer/dept/get/{id}")
    public String getId(@PathVariable("id") Long id){
    return deptService.getId(id);
    }
    @RequestMapping("/add/{name}")
    public String addDept( Dept dept,@PathVariable("name") String name){
     return deptService.addDept(dept);
    }
    @RequestMapping("/dept/list")
    public String getList(){
        return deptService.getList();}

}
